#ifndef ELLIPTIC_CURVE_DLP_H
#define ELLIPTIC_CURVE_DLP_H

#include "sidh_elliptic_curve.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Computes the discrete logarithm {@code P = x * Q} in a group of order
 * {@code l^e} generated by {@code P}. The Pohlig–Hellman algorithm is used.
 * @param x the discrete logarithm if it exists, or -1 otherwise
 * @param P the generator of the cyclic group
 * @param Q an element in the the group generated by {@code P}
 * @param E
 * @param l a prime number
 * @param e a positive integer
 */
void oqs_sidh_iqc_ref_elliptic_curve_prime_power_dlp(mpz_t x,
                                                     const point_t P,
                                                     const point_t Q,
                                                     const elliptic_curve_t E,
                                                     long l,
                                                     long e);

/**
 * Computes the discrete logarithm {@code P = x * Q} in a group of order
 * {@code l} generated by {@code P}.
 * @param P the generator of the cyclic group
 * @param Q an element in the the group generated by {@code P}
 * @param E
 * @param l a prime number
 * @return the discrete logarithm if it exists, or -1 otherwise
 */
long oqs_sidh_iqc_ref_elliptic_curve_prime_dlp(const point_t P,
                                               const point_t Q,
                                               const elliptic_curve_t E,
                                               long l);

#ifdef __cplusplus
}
#endif

#endif /* ELLIPTIC_CURVE_DLP_H */
